#include"vector.hpp"
void test1()
{
	hcc::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	for (auto e : v)
	{
		cout << e << "->";
	}
	cout << endl;
	cout << v.capacity() << endl;
	cout << v.size() << endl;
}
void test2()
{
	hcc::vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);
	v1.push_back(6);
	v1.push_back(7);
	hcc::vector<int> v2;
	v2 = v1;
	hcc::vector<int> v3(v2.begin(), v2.end());

}
void test3()
{
	hcc::vector<int> l;
	l.push_back(4);
	l.push_back(3);
	l.push_back(2);
	l.push_back(1);
	sort(l.begin(), l.end(),less<int>());
	for (const auto& e : l)
	{
		cout << e << "->";
	}
	cout << endl;
	auto it = find(l.begin(), l.end(), 3);
	l.earse(it);
	for (const auto& e : l)
	{
		cout << e << "->";
	}
}
void test4()
{
	hcc::vector<int> l;
	l.push_back(1);
	l.push_back(2);
	l.push_back(3);
	l.push_back(4);
	l.push_back(5);
	hcc::vector<int>::iterator it = l.begin();
	while (it != l.end())
	{
		if (*it % 2 == 0)
			it = l.earse(it);
		else
			it++;
	}
	for (const auto& e : l)
	{
		cout << e << "->";
	}
}
void test5()
{
	hcc::vector<int> l;
	l.push_back(1);
	l.push_back(2);
	l.push_back(3);
	l.push_back(4);
	l.push_back(5);
	l.push_back(6);
	l.push_back(7);
	for (const auto& e : l)
	{
		cout << e << "->";
	}
	cout << endl;
	l.pop_back();
	l.pop_back();
	l.pop_back();
	l.pop_back();
	for (const auto& e : l)
	{
		cout << e << "->";
	}
	cout << endl;
}
void test6()
{
	hcc::vector<int> l;
	l.push_back(1);
	l.push_back(2);
	l.push_back(3);
	l.push_back(4);
	l.push_back(5);
	l.push_back(6);
	l.push_back(7);
	auto it = find(l.begin(), l.end(), 6);
	l.insert(it, 5);
	for (const auto& e : l)
	{
		cout << e << "->";
	}
	cout << endl;
}
void test7()
{
	class Solution {
	public:
		void generate(int numRows)
		{
			hcc::vector<hcc::vector<int>> vv;
			size_t i = 0;
			size_t j = 0;
			vv.resize(numRows);
			for (i = 0; i < vv.size(); i++)
			{
				vv[i].resize(i + 1);
				vv[i].front() = vv[i].back() = 1;
			}
			for (i = 2; i < vv.size(); i++)
			{
				for (j = 1; j < vv[i - 1].size(); j++)
				{
					vv[i][j] = vv[i - 1][j - 1] + vv[i - 1][j];
				}
			}
			for (i = 0; i < vv.size(); i++)
			{
				for (j = 0; j < vv[i].size(); j++)
				{
					cout << vv[i][j] << "->";
				}
				cout << endl;
			}
		}
	};
	Solution().generate(5);
}
int main()
{
	//test1();
	//test2();
	//test3();
	//test4();
	//test5();
	//test6();
	test7();
	return 0;
}